package lumis.portal.page.webresource;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lumis.portal.stability.StableMinor;

/**
 * POJO for holding customizable data for a page web resource.
 *
 * @version $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
 * @since 5.0.0
 */
@StableMinor(version = "6.0", sinceVersion = "5.0")
public class PageWebResourceData
{
	private String title;
	private String description;
	private List<String> keywords = new ArrayList<String>();
	
	/**
	 * Map to hold the meta tags.
	 * @since 6.0.0
	 */
	private Map<String, String> metaTags = new HashMap<String, String>(); 

	/**
	 * Sets the page web resource title.
	 * 
	 * @param title the title.
	 * @since 5.0.0
	 */
	public void setTitle(String title)
	{
		this.title = title;
	}

	/**
	 * Sets the page web resource description.
	 * 
	 * @param description the description.
	 * @since 5.0.0
	 */
	public void setDescription(String description)
	{
		this.description = description;
	}

	/**
	 * Sets the page web resource keywords.
	 * 
	 * @param keywords the keywords. Must not be null. If no keywords is 
	 * desired, an empty list may be used.
	 * @since 5.0.0
	 */
	public void setKeywords(List<String> keywords)
	{
		if (keywords == null)
			throw new IllegalArgumentException("keywords cannot be null");
		this.keywords = keywords;
	}

	/**
	 * Sets the page meta tags map.
	 * @param metaTagMap	the new meta tags map.
	 * @since 6.0.0
	 */
	public void setMetaTags(Map<String, String> metaTags)
	{
		this.metaTags = metaTags;
	}

	/**
	 * Returns the page web resource title.
	 * 
	 * @return the title.
	 * @since 5.0.0
	 */
	public String getTitle()
	{
		return title;
	}

	/**
	 * Returns the page web resource description.
	 * 
	 * @return the description.
	 * @since 5.0.0
	 */
	public String getDescription()
	{
		return description;
	}

	/**
	 * Returns the page web resource keywords.
	 * 
	 * @return the keywords. Never returns <code>null</code>, but may return
	 * an empty list if there is no keyword.
	 * @since 5.0.0
	 */
	public List<String> getKeywords()
	{
		return keywords;
	}

	/**
	 * Returns the page meta tags in a map.
	 * @return	a map containing the page meta tags.
	 * @since 6.0.0
	 */
	public Map<String, String> getMetaTags()
	{
		return metaTags;
	}
}